package com.example.mapboxdemo;

import android.annotation.SuppressLint;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.mapbox.maps.MapView;


public class MainActivity extends AppCompatActivity {
    private MapView mapView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mapView = findViewById(R.id.mapView);
//        mapView.getMapboxMap().loadStyleUri(Style.TRAFFIC_NIGHT);
        mapView.getMapboxMap().loadStyleUri("mapbox://styles/hambugerdevelop/cl24b4ex7000a14nz5sz6o4z1");
    }

    @SuppressLint("Lifecycle")
    @Override
    protected void onStart() {
        super.onStart();
        if(mapView!=null){
            mapView.onLowMemory();
        }
    }

    @SuppressLint("Lifecycle")
    @Override
    protected void onStop() {
        super.onStop();
        if(mapView!=null){
            mapView.onLowMemory();
        }
    }

    @SuppressLint("Lifecycle")
    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mapView!=null){
            mapView.onLowMemory();
        }
    }

    @SuppressLint("Lifecycle")
    @Override
    public void onLowMemory() {
        super.onLowMemory();
        if(mapView!=null){
            mapView.onLowMemory();
        }
    }
}